﻿<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
    xmlns:dssp="http://schemas.microsoft.com/xw/2004/10/dssp.html"
    xmlns:svc="http://schemas.socgadget.com/2010/05/xbeeservice.html"
    >
    
    <xsl:import href="/resources/dss/Microsoft.Dss.Runtime.Home.MasterPage.xslt" />
    <xsl:template match="/">
        <xsl:comment>
            <!--  Service Header Info 
  -->
        </xsl:comment>
        <xsl:variable name="title">SoCGadget XBeeService - Service State</xsl:variable>
        <xsl:variable name="serviceName">SoCGadget XBeeService</xsl:variable>
        <xsl:variable name="description">SoCGadget XBeeService Service</xsl:variable>
        <xsl:call-template name="MasterPage">
            <xsl:with-param name="serviceName" select="$serviceName" />
            <xsl:with-param name="description" select="$description" />
            <!--  If title is not provided, serviceName will be used instead. 
  -->
            <xsl:with-param name="title">
                <xsl:value-of select="$serviceName" />
                <xsl:if test="$title != ''">
                    <xsl:text>-</xsl:text>
                    <xsl:value-of select="$title" />
                </xsl:if>
            </xsl:with-param>
            <!-- 
 Possible values for navigation are: 'Open', 'Closed', and 'None'
           'Open' is the default value. 

  -->
            <xsl:with-param name="navigation" select="'Open'" />
            <!--  Turn on/off XML Button for RAW XML view. Options are: 'None' and 'Show' 
  -->
            <xsl:with-param name="xmlButton" select="'Show'" />
            <!--  The contents of head param will be placed just before the </head> tag in html. 
  -->
            <xsl:with-param name="head">
                <style type="text/css">/* Service-specific stylesheet goes here */</style>
                <script language="javascript" type="text/javascript">
                    <![CDATA[ 
                        <!--

                        /* Service-specific script goes here */

                        dssRuntime.init = function()
                        {
                          // Add page initialization code here.
                          // This function is attached to the window.onload event.
                          // Do not override window.onload.
                        }

                        //-->     

                    ]]>
                </script>
            </xsl:with-param>
        </xsl:call-template>
    </xsl:template>
    <!--  Match service state's document element. 
  -->
    <xsl:template match="/svc:XBeeServiceState">
        <table border="1">
            <tr class="odd">
                <th colspan="2">Service State</th>
            </tr>
            <tr class="even">
                <th>SerialPort:</th>
                <td>
                    <xsl:value-of select="svc:SerialPort"/>
                </td>
            </tr>
            <tr class="odd">
                <th>Baud:</th>
                <td>
                    <xsl:value-of select="svc:Baud"/>
                </td>
            </tr>
            <tr class="even">
                <th>ApiMode:</th>
                <td>
                    <xsl:value-of select="svc:ApiMode"/>
                </td>
            </tr>
            <tr class="even">
                <th>IsConnected:</th>
                <td>
                    <xsl:value-of select="svc:IsConnected"/>
                </td>
            </tr>
        </table>
    </xsl:template>
</xsl:stylesheet>